import Vue from 'vue';
import Router from 'vue-router';
import index from '@/components/index';
import activityRules from '@/components/activityRules';
import createFeast from '@/components/createFeast';
import latestPlace from '@/components/latestPlace';
import exchange from '@/components/exchange';
import areaGift from '@/components/areaGift';
import setInfo from  '@/components/setInfo';
import joinFeast from "@/components/joinFeast";
import joinRank from "@/components/joinRank";
import userRanklist from "@/components/userRanklist";
import myRanklist from "@/components/myRanklist";

Vue.use(Router);

export default new Router({
  routes: [
    {
      path: '/',
      name: 'host',
      redirect: '/index'
    },
    {
      path: '/index',
      name: 'index',
      components: {
        default: index
      }
    },
    {
      path: '/index/activity_rules',
      name: 'activityRules',
      components: {
        default: activityRules
      }
    },
    {
      path: '/index/activity_rules/create_feast',
      name: 'createFeast',
      components: {
        default: createFeast
      }
    },
    {
      path: '/index/gift',
      name: 'areaGift',
      components: {
        default: areaGift
      }
    },
    {
      path: '/index/gift/latest_place',
      name: 'latestPlace',
      components: {
        default: latestPlace
      }
    },
    {
      path: '/index/gift/exchange',
      name: 'exchange',
      components: {
        default: exchange
      }
    },
    {
      path: '/join_feast',
      name: 'joinFeastNull',
      redirect: '/index'
    },
    {
      path: '/join_feast=',
      name: 'joinFeastEmpty',
      redirect: '/index'
    },
    {
      path: '/join_feast=:master',
      name: 'joinFeast',
      components: {
        default: joinFeast
      }
    },
    {
      path: '/join_feast/ranklist',
      name: 'userRanklist',
      components: {
        default: userRanklist
      }
    },
    {
      path: '/join_rank',
      name: 'joinRank',
      components: {
        default: joinRank
      }
    },
    {
      path: '/join_rank/set_info',
      name: 'setFeastInfo',
      components: {
        default: setInfo
      }
    },
    {
      path: '/join_rank/ranklist',
      name: 'myRanklist',
      components: {
        default: myRanklist
      }
    }
  ]
});
